<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script language="Javascript">
	function xmlhttpPost() {
		var strURL = document.getElementById('url').value;
		var xmlHttpReq = false;
		var self = this;
		// Mozilla/Safari
		if (window.XMLHttpRequest) {
			self.xmlHttpReq = new XMLHttpRequest();
		}
		// IE
		else if (window.ActiveXObject) {
			self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
		}
		self.xmlHttpReq.open('GET', strURL, true);
		self.xmlHttpReq.setRequestHeader('Content-Type',
				'application/x-www-form-urlencoded');
		self.xmlHttpReq.onreadystatechange = function() {
			if (self.xmlHttpReq.readyState == 4) {

				var json = JSON.parse(self.xmlHttpReq.responseText);

				document.getElementById("result").innerHTML = JSON
						.stringify(json);

			}
		};
		self.xmlHttpReq.send(strURL);

	}
</script>
</head>
<body>

	<form>
		<label>Enter the API URL</label> <input type='text' id='url'>
		<input value='submit' onclick='JavaScript:xmlhttpPost()' type='button'>
		<br /> <label>Response</label>
		<p id="result"></p>
	</form>

</body>
</html>